<?php defined('SYSPATH') or die('No direct script access.');

	/**
	 * Configuration array for the AuthorEyes system.
	 *
	 * @package     AuthorEyes
	 * @subpackage  Config
	 * @category    Authentication
	 * @author      Patrick Clark (Tap)
	 * @copyright   Copyright (c) 2008, pubblichi.com
	 * @license     http://www.gnu.org/licenses/lgpl.html
	 * @link        http://www.pubblichi.com/authoreyes
	 * @info        This is an adaptation of the FreakAuth Light authentication library, 
	 * @info        written specifically for Kohana.
	 * @info     	FreakAuth Light written by Daniel Vecchiato (danfreak) & Christophe Gragnic (grahack)
	 * @info        Visit www.4webby.com/freakauth to download FreakAuth Light for CodeIgniter
	 * @version     0.1
	 */
	
	
	/*---------------------+
	|  MAIN CONFIGURATION  |
	+---------------------*/
	 
	 /*
	 |--------------------------------------------------------------------------
	 | Name of the website
	 |--------------------------------------------------------------------------
	 |
	 | It will be displayed in some headers and in the subject of the emails.
	 |
	 */
	 $config['ae_website_name'] = "YOUR_DOMAIN.com";
	 
	 /*
	 |--------------------------------------------------------------------------
	 | E-mail address of the administrator
	 |--------------------------------------------------------------------------
	 |
	 | It will be displayed in some headers and in the subject of the emails.
	 |
	 */
	 $config['ae_user_support'] = 'you@your-email.com';
	 
	 /*
	 |--------------------------------------------------------------------------
	 | Enable/Disable AuthorEyes system
	 |--------------------------------------------------------------------------
	 |
	 | The "turned_off" template will be displayed if FALSE.
	 |
	 */
	 $config['ae'] = TRUE;
	 
	 /*
	 |------------------------------------------------------------------------------
	 | The table prefix for the database tables needed by AuthorEyes.
	 |------------------------------------------------------------------------------
	 | 
	 | Table extension property, used to easily identify AuthorEyes tables.
	 | 
	 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	 | WARNING: Read the following paragraph before you change change this config setting
	 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	 | 
	 */
	 $config['ae_table_prefix'] = 'ae_';
	
	
	/*---------------+
	|  DENY PROCESS  |
	+---------------*/
	
	 /*
	 |--------------------------------------------------------------------------
	 | Enable/Disable the Flash Message notice system FOR THE DENY SYSTEM ONLY.
	 |--------------------------------------------------------------------------
	 |
	 | When a visitor is not allowed to see a particular page, his/her access
	 | is "denied".
	 |
	 | If TRUE, ae uses a FLASH message and a "redirect back" to deny the visitor.
	 | If FALSE, ae only loads the page you defined in $config['ae_denied_page'].
	 |
	 */
	 $config['ae_deny_with_flash_message'] = TRUE;
	 
	 /*
	 |-------------------------------------------------------------------------------
	 | Page where the valid users are taken when access is denied & no local referer.
	 |-------------------------------------------------------------------------------
	 |
	 | If the denied user comes from another website and is NOT a guest,
	 | this is the Kohana location to take him.
	 |
	 | Guests are taken to the login page (see the login_uri key).
	 |
	 */
	 $config['ae_denied_from_ext_location'] = '';
	                             
	 /*
	 |------------------------------------------------------------------------------
	 | Page loaded if 'ae_deny_with_flash_message' is set to FALSE.
	 |------------------------------------------------------------------------------
	 |
	 | If you don't want to use a flash message, this is the page/view we want to 
	 | load to display the deny message.
	 |
	 */
	 $config['ae_denied_page'] = 'template/denied';
	 
	
	/*----------------+
	|  USER HANDLING  |
	+----------------*/
	
	 /*
	 |------------------------------------------------------------------------------
	 | Whether users are allowed to register by themselves.
	 |------------------------------------------------------------------------------
	 */
	 $config['ae_allow_user_registration'] = TRUE;
	 
	 /*
	 |------------------------------------------------------------------------------
	 | Whether the registration/activation process is direct or requires e-mail
	 | verification.
	 |------------------------------------------------------------------------------
	 | 
	 | If set to FALSE, the registration process is as follows:
	 | 1. The user registers on the website (data stored in user_temp table).
	 | 2. The user gets a registration e-mail with an activation link.
	 | 3. If the user clicks the activation link (data moved to user table),
	 |    he/she is registered and can login with his/her credentials.
	 |
	 | If set to TRUE, the registration process is as follows:
	 | 1. The user registers to the website (data stored in user table).
	 | 2. The user can immediately login.
	 | 3. No e-mail is sent to the user to remember his credentials.
	 |    i.e. username and password.
	 |
	 */
	 $config['ae_register_direct'] = FALSE;
	 
	 
	 /*
	 |------------------------------------------------------------------------------
	 | Usernames and passwords configuration.
	 |------------------------------------------------------------------------------
	 */
	 $config['ae_user_pass_settings'] = array(
	 	'username_min'      => 4,                                     // Min username length.
	 	'username_max'      => 16,                                    // Max username length.
	 	'user_password_min' => 6,                                     // Min password length.
	 	'user_password_max' => 16,                                    // Max password length.
		'salt_pattern'      => '1, 3, 5, 9, 14, 15, 20, 21, 28, 30',  // Salt pattern to hash the password.
		'hash_method'       => 'sha1',                                // The hash method to be used to hash the password.
	 );
	
	 /*
	 |------------------------------------------------------------------------------
	 | Whether to use country listing for registration.
	 |------------------------------------------------------------------------------
	 */
	 $config['ae_use_country'] = TRUE;
	 
	 /*
	 |------------------------------------------------------------------------------
	 | Whether to use a custom user profile or not.
	 |------------------------------------------------------------------------------
	 |
	 | Set this config setting to TRUE to use a custom user profile.
	 | Set this config setting to FALSE to avoid using a custom user profile.
	 |
	 */
	 $config['ae_create_user_profile'] = TRUE;
	 
	 /*
	 |------------------------------------------------------------------------------
	 | Whether to use CAPTCHA (security code) functionality for those processes.
	 |------------------------------------------------------------------------------
	 */
	 $config['ae_captcha_settings'] = array(
	 	'use_captcha_login'           => TRUE,
	 	'use_captcha_register'        => TRUE,
	 	'use_captcha_forgot_password' => TRUE,
	 );
	 
	 /*
	 |------------------------------------------------------------------------------
	 | The time that a new registered user has for activation (Default: 1 day).
	 |------------------------------------------------------------------------------
	 |
	 | If you change this setting, remember to change email templates as well.
	 |
	 */
	 $config['ae_temporary_users_expiration'] = 3600*24;
	 
	
	/*-------------------------------------------+
	|  CUSTOM CONTROLLER/METHOD NAMING SETTINGS  |
	+--------------------------------------------*/
	
	 /*
	 |------------------------------------------------------------------------------
	 | Flexible controller/method naming conventions.
	 |------------------------------------------------------------------------------
	 |
	 | You can name the controllers and relative actions as you like.
	 |
	 | Namely you can place the login, logout, register, changepassword, etc. actions
	 | in a single controller (like we did in the demo application), or in several 
	 | controllers of your choice.
	 |
	 | If you want to use this freedom you must set/change the following parameters.
	 | For each of the following settings you must provide the controller_name/method_name
	 | (or simply the controller_name if you just have an index() method in it.
	 | --------
	 | NOTE!
	 | --------
	 | For:
	 | - $config['ae_activation_uri']
	 | - $config['ae_forgottenPasswordReset_uri']
	 | It is compulsory to specify both the controller_name/method_name even if the
	 | method is index().
	 */
	 $config['ae_controller_conventions'] = array(
	 	'login_uri'                    => 'auth/login',
	 	'logout_uri'                   => 'auth/logout',
	 	'register_uri'                 => 'auth/register',
	 	'activation_uri'               => 'auth/activation',               //read the above note
	 	'change_password_uri'          => 'auth/changepassword',
	 	'forgotten_password_uri'       => 'auth/forgotten_password',
	 	'forgotten_password_reset_uri' => 'auth/forgotten_password_reset', //read the above note
	 );
	
	 
	/*--------------------+
	|  TEMPLATE SETTINGS  |
	+--------------------*/
	
	 /*
	 |-----------------------------------------------------------------------------
	 |  Directory for AuthorEyes views assets.
	 |-----------------------------------------------------------------------------
	 |
	 | Where we place our css, images, javascript files.
	 |
	 | This is handy if you use other templating systems.
	 |
	 | Place public on the same filesystem level as your 
	 | application/modules/system directories.
	 |
	 */
	 $config['ae_asset_directories'] = array(
		'assets'        => 'public', //main assets folder
		'css'           => 'css',
		'images'        => 'images',
		'js'            => 'js',
	);
	
	$config['ae_asset_subdirectories'] = array(
		'assets_shared' => $config['ae_asset_directories']['assets'].'/shared',   //shared assets
		'assets_front'  => $config['ae_asset_directories']['assets'].'/frontend', //admin frontend
		'assets_admin'  => $config['ae_asset_directories']['assets'].'/admin',    //admin backend
	);
	
	/*
	|------------------------------------------------------------------
	| Cookie (autologin) settings (not implemented yet...)
	|------------------------------------------------------------------
	|
	| Time (in seconds) that the autologin cookie remains valid.
	|
	| !NOTE: not used so far. It's here for future REMEMBER ME 
	|        implementation
	|
	*/
	$config['ae_auto_login_period'] = 60*60*24*30;
	
	
	/*-------------------+
	|  VALIDATION RULES  |  !!!!!THIS WILL PROBABLY HAVE TO BE CHANGED ONCE IMPLEMENTED IN KOHANA!!!!!
	+-------------------*/
	
	 // GENERAL RULES
	  $config['ae_country_validation'] = 'trim|required|numeric|xss_clean|country_check';
	
	 // PASSWORD
	  $config['ae_password_required_validation'] = 'trim|required|xss_clean|password_check';
	  $config['ae_password_required_confirm_validation'] = 'trim|required|xss_clean|matches[password]';

	 // USERNAME
	  // Username validation (required): checks if min-max characters settings are respected
	  // and if username is not already present in DB.
	  $config['ae_username_duplicate_validation'] = 'trim|required|xss_clean|username_check|username_duplicate_check';
	
	 // LOGIN
	  $config['ae_username_field_validation_login'] = 'trim|required|xss_clean';
	  $config['ae_user_password_field_validation_login'] = 'trim|required|xss_clean';
	
	 // REGISTRATION
	  $config['ae_username_field_validation_register'] = $config['ae_username_duplicate_validation'];
	  $config['ae_user_password_field_validation_register'] = $config['ae_password_required_validation'];
	  $config['ae_user_email_field_validation_register'] = 'trim|required|valid_email|xss_clean|email_duplicate_check';
	  $config['ae_user_country_field_validation_register'] = $config['ae_country_validation'];
	
	 // SECURITY CODE
	  $config['ae_user_captcha_field_validation'] = 'trim|required|xss_clean|securitycode_check';
	
	 // FORGOTTEN PASSWORD
	  $config['ae_user_email_field_validation_forgotten'] = 'trim|required|valid_email|xss_clean|email_exists_check';
	
	
	/*-------------------+
	|  CAPTCHA SETTINGS  |
	+-------------------*/
	
	$config['ae_captcha_settings'] = array(
		'case_sensitive'               => TRUE,  // Utilize case sensitivity.
		'use_letters'                  => TRUE,  // Use upper case letters.
		'use_numbers'                  => TRUE,  // Use numbers.
		);
	
	
	/*----------------+
	|  VIEW SETTINGS  |
	+----------------*/
	 
	 /*
	 |------------------------------------------------------
	 | Directory of your AuthorEyes templates
	 |------------------------------------------------------
	 |
	 | Relative to the modules/authoreyes/views folder.
	 | Please add a trailing slash.
	 |
	 */
	 $config['ae_template_dir'] = '/';
	
	 // LOGIN
	 
	  // The view to display the login form.
	  $config['ae_login_view'] = $config['ae_template_dir'].'content/forms/login';
	
	 // REGISTRATION
	 
	  // View to display the user registration form.
	  $config['ae_register_view'] = $config['ae_template_dir'].'content/forms/register';
	  
	  // View to display the successful registration information.
	  $config['ae_register_success_view'] = $config['ae_template_dir'].'content/register_success';
	  
	  // View to display the successful activation information.
	  $config['ae_register_activation_success_view'] = $config['ae_template_dir'].'content/activation_success';
	  
	  // View to display the failed activation information.
	  $config['ae_register_activation_failed_view'] = $config['ae_template_dir'].'content/activation_failed';
	
	 // FORGOTTEN PASSWORD
	 
	  // View to display the forgotten password form.
	  $config['ae_forgotten_password_view'] = $config['ae_template_dir'].'content/forms/forgotten_password';
	  
	  // View to display the successful forgotten password request.
	  $config['ae_forgotten_password_success_view'] = $config['ae_template_dir'].'content/forgotten_password_success';
	  
	  // View to display the successful forgotten password reset.
	  $config['ae_forgotten_password_reset_success_view'] = $config['ae_template_dir'].'content/forgotten_password_reset_success';
	  
	  // View to display the failed forgotten password reset.
	  $config['ae_forgotten_password_reset_failed_view'] = $config['ae_template_dir'].'content/forgotten_password_reset_failed';
	
	 // CHANGE PASSWORD
	 
	  // View to display the forgotten password form.
	  $config['ae_change_password_view'] = $config['ae_template_dir'].'content/forms/change_password';
	  
	 // CAPTCHA VIEW
	 
	  // View to display the captcha box.
	  $config['ae_captcha_img_tag_view'] = $config['ae_template_dir'].'content/forms/html_for_captcha';
	  
	 // SYSTEM TURNED OFF VIEW
	  $config['ae_system_turned_off'] = $config['ae_template_dir'].'content/turned_off';
	  
	 // ERROR DELIMITERS
	 
	  // Opening tag for the validation error messages
	  $config['ae_error_delimiter_open'] = '<div class="error">';
	  
	  // Closing tag for the validation error messages
	  $config['ae_error_delimiter_close'] = '</div>';
	
	
	/*--------------------------+
	|  E-MAIL CONTENT SETTINGS  |
	+--------------------------*/
	
	 // Who the e-mail is coming from.
	 $config['ae_email_from'] = 'webmaster';
	 
	 // The location of the activation email
	 $config['ae_activation_email'] = $config['ae_template_dir'].'email/activation_email';
	 
	 // The location of the forgotten password email
	 $config['ae_forgotten_password_email'] = $config['ae_template_dir'].'email/forgotten_password_email';
	 
	 // The location of the forgotten password reset email
	 $config['ae_forgotten_password_reset_email'] = $config['ae_template_dir'].'email/forgotten_password_reset_email';
	 
	 // View to send by email for the change password informations
	 $config['ae_change_password_email'] = $config['ae_template_dir'].'email/change_password_email';
	
	
	/*-------------------+
	|  ACTIONS SETTINGS  |  Possibly containing redirects?
	+-------------------*/
	
	 // The action to execute after successful login.
	 $config['ae_login_success_action'] = '';
	 
	 // The action to execute after successful logout.
	 $config['ae_logout_success_action'] = '';
	 
	 // The action to execute after REGISTRATION ('continue' link).
	 $config['ae_register_continue_action'] = '';
	 
	 // The action to execute after ACTIVATION, ('continue' link).
	 // Whether it failed or it was successful
	 $config['ae_activation_continue_action'] = 'auth';
	 
	 // The action to execute after requesting FORGOTTEN PASSWORD.
	 $config['ae_forgotten_password_continue_action'] = '';
	
 
	/*-----------------+
	|  ADMIN SETTINGS  |
	+-----------------*/
	
	// The action to execute after successful ADMIN login.
	$config['ae_admin_login_success_action'] = 'admin';
	
	// The action to execute after successful ADMIN logout.
	$config['ae_admin_logout_success_action'] = '';
	
	// The number of records per page for the admin user listing (pagination).
	$config['ae_admin_console_records_per_page'] = 2;
	
	/*
	|-------------------------------------------------------------------------------
	| ACL ROLES SETTINGS
	|-------------------------------------------------------------------------------
	| 
	| AuthorEyes roles work by inheritance.
	|
	| This means that the lower the value of the role, the higher it is in the
	| hierarchy:
	| 	Example 1: superadmin (value 1) has more rights than admin (value 2)
	| 	Example 2: editor (value 3) has more rights than user (value 100)
	| 
	| You can also set usergroups with the same hierarchy:
	|   Example 1: 'editor' => 4,
	|   Example 2: 'gallery_manager' => 4
	|
	| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	| WARNING: Read the following paragraph before you change change this config setting
	| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	|
	| The ACL role groups should be between the numbers 3 and 99.  
	| 1 is reserved for superadmin
	| 2 is reserved for admin
	| 100 is reserved for user
	|
	*/
	$config['ae_roles'] = array(
		//Don't change the two following lines//
		'superadmin' => 1,
		'admin' => 2,
		//End don't change
		
		//Add your custom roles here (without the Example (num):)
		//Example 1: 'editor' => 3,
		//Example 2: 'gallery_manager' => 4
		//--------------------------
		
		//Don't change the following line
		'user' => 100,
	);
	
	/*
	|-------------------------------------------------------------------------------
	| CUSTOM USER FIELDS SETTINGS (ae_user_profile table)
	|-------------------------------------------------------------------------------
	|
	| You can set how many custom validation fields you want.
	|
	| In the DB table they can be of any type (varchar, text, int etc.).
	|
	| WARNING-> The system will automatically bring the fields from DB.
	|           If you set less rules/fields here in config, the system will use
	|           the table field name as field for the missing ones,
	|           and won't set any rule for them.
	|
	| You can call your fields in DB as you like.
	|
	| The array keys in this config refer to the name of the fields in DB tables.
	| The array values will be displayed on the page.
	|
	*/
	$config['ae_user_profile_field_names'] = array(
		'field_1' => 'name',
		'field_2' => 'surname',
		'call_me_nicely' => 'AuthorEyes&copy; rocks',
		//'field_3'=>'whatyouwant',
		//'field_4'=>'whatyouwant',
	);
	
	/*
	|-------------------------------------------------------------------------------
	| RULES FOR YOUR CUSTOM USER_PROFILE FIELDS  !!!!THIS NEEDS TO BE LOOKED AT!!!!
	|-------------------------------------------------------------------------------
	|
	| If you need callback validation functions, remember to include them in your 
	| controllers.
	|
	*/
	$config['ae_user_profile_fields_validation_rules'] = array(
		'field_1' => 'trim|required',
		'field_2' => 'trim|required|max_length[50]',
		'call_me_nicely' => 'trim|required|max_length[3]',
		//'field_4' => 'whatyouwant',
		//'field_5' => 'whatyouwant',
	);
		
?>